<template>
  <div class="helper-tabs">
    <scroll-view scroll-x="true">
      <div class="xingcheng1">
          <div class="xingcheng1-1" :class="activeIndex == index ? 'active' : ''" v-for="(item, index) in times" :key="index" @click="selectTime(item, index)">{{ day(item.dictLabel) }} <div class="small">{{ week(item.dictLabel) }}</div></div>
          <div class="xingcheng1-1" style="opacity: 0">1</div>
      </div>
    </scroll-view>
  </div>
</template>

<script>
import protal from "@/api/protal"

export default {
  data() {
    return {
        activeIndex: 0,
        times: [],
    }
  },
  created() {
  	this.getData()
  },
  computed: {
  },
  methods: {
	getData() {
		protal.getOnlineZdCode('forum_date').then(res => {
		    this.times = res.data
		    this.selectTime(this.times[0], 0)
		})
	},
    selectTime(item, index) {
      this.activeIndex = index
      this.$emit('forumDateFn', item.dictLabel)
    }
  }
}
</script>

<style lang="less" scoped>
  .helper-tabs {
    width: 100%;
    border-bottom: 1px solid #1E234B;

    /deep/ .happy-scroll-container {
      width: 100% !important;
      height: auto !important;
    }

    /deep/ .happy-scroll-strip {
      display: none !important;
    }

    .xingcheng1 {
        width: 100%;
        display: flex;

        .xingcheng1-1 {
            font-family: AlibabaPuHuiTi_2_75_SemiBold;
            font-size: 15px;
            color: #000000;
            line-height: 49px;
            text-align: left;
            font-style: normal;
            display: inline-flex;
            align-items: center;
            position: relative;
            white-space: nowrap;
			padding: 0 14px;

            .small {
                font-family: AppleSystemUIFont;
                font-size: 13px;
                color: #000000;
                line-height: 40px;
                text-align: left;
                font-style: normal;
            }

            &.active {
				background-color: #7350F5;
				color: #fff;
				
				.small {
					color: #fff;
				}
            }
        }
    }
  }
</style>
